package pwd.allen.web.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
import pwd.allen.config.MainConfig;

/**
 * 用来替换web.xml
 *
 * @author 门那粒沙
 * @create 2021-12-05 16:32
 **/
public class AnnotationConfigInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

    /**
     * Spring应用程序上下文中的配置bean
     * @return
     */
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[] {MainConfig.class};
    }

    /**
     * Spring MVC应用程序上下文中的配置bean
     * @return
     */
    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[] {WebConfig.class};
    }

    @Override
    protected String[] getServletMappings() {
        return new String[] {"/"};
    }
}
